/**
 * 
 */
package cn.softTank.BpelModelImpl;

import org.dom4j.DocumentHelper;
import org.dom4j.Element;

import cn.softTank.BpelModel.TransitionCondition;

/**
 * @author Yuzone
 *
 */
public class TransitionConditionImpl implements TransitionCondition {

	private String expression;
	private String expressionLanguage;
	
	/* (non-Javadoc)
	 * @see cn.softTank.BpelModel.TransitionCondition#getBoolExpression()
	 */
	@Override
	public String getBoolExpression() {
		return this.expression;
	}

	/* (non-Javadoc)
	 * @see cn.softTank.BpelModel.TransitionCondition#getExpressionLanguage()
	 */
	@Override
	public String getExpressionLanguage() {
		return this.expressionLanguage;
	}

	/* (non-Javadoc)
	 * @see cn.softTank.BpelModel.TransitionCondition#setBoolExpression(java.lang.String)
	 */
	@Override
	public void setBoolExpression(String boolExpr) {
		this.expression=boolExpr;
	}

	/* (non-Javadoc)
	 * @see cn.softTank.BpelModel.TransitionCondition#setExpressionLanguage(java.lang.String)
	 */
	@Override
	public void setExpressionLanguage(String expressionLanguage) {
		this.expressionLanguage=expressionLanguage;
	}

	/* (non-Javadoc)
	 * @see cn.softTank.BpelModel.XmlAdapt#toElement()
	 */
	@Override
	public Element toElement() {
		Element e=DocumentHelper.createElement("transitionCondition");
		if(expressionLanguage!=null)
			e.addAttribute("expressionLanguage", expressionLanguage);
		if(expression!=null)
			e.addText(expression);
		return e;
	}

	/* (non-Javadoc)
	 * @see cn.softTank.BpelModel.XmlAdapt#toXml()
	 */
	@Override
	public String toXml() {
		// TODO Auto-generated method stub
		return null;
	}

}
